bitkeeper revision 1.1159.1.412 (4193a1919CNLBKTNSj3aLn7Jd6TpGA)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 11 Nov 2004 17:29:53 +0000 (17:29 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Thu, 11 Nov 2004 17:29:53 +0000 (17:29 +0000)
Synchronize domain time updates between CPUs.

xen/arch/x86/time.c
xen/common/domain.c
xen/include/xen/sched.h

index 7ee85cc22a15b9d479f2ddc477685ce0af2f4546..cc9ef381b934c64e09d82c445b05ade27370776a 100644 (file)
@@ -281,6 +281,8 @@ void update_dom_time(struct domain *d)
 
     read_lock_irqsave(&time_lock, flags);
 
+    spin_lock(&d->time_lock);
+
     si->time_version1++;
     wmb();
 
@@ -293,6 +295,8 @@ void update_dom_time(struct domain *d)
     wmb();
     si->time_version2++;
 
+    spin_unlock(&d->time_lock);
+
     read_unlock_irqrestore(&time_lock, flags);
 }
 
index d35d19d43c44115636bf2ef9d87d01c99ceef594..ba54ae4d69a6fffdde73cb3c053780b202716f25 100644 (file)
@@ -44,6 +44,8 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu)
  
     memcpy(&ed->thread, &idle0_exec_domain.thread, sizeof(ed->thread));
 
+    spin_lock_init(&d->time_lock);
+
     spin_lock_init(&d->page_alloc_lock);
     INIT_LIST_HEAD(&d->page_list);
     INIT_LIST_HEAD(&d->xenpage_list);
index 01479cc031057b74638401a6efabb93e18cfd543..d33806b326dccd7c16862f26654f4bbc34dea7b5 100644 (file)
@@ -109,10 +109,11 @@ struct exec_domain
 };
 
 struct domain {
-    domid_t  id;
-    s_time_t create_time;
+    domid_t          id;
+    s_time_t         create_time;
 
-    shared_info_t *shared_info;       /* shared data area */
+    shared_info_t   *shared_info;     /* shared data area */
+    spinlock_t       time_lock;
 
     spinlock_t       page_alloc_lock; /* protects all the following fields  */
     struct list_head page_list;       /* linked list, of size tot_pages     */